import React, { useEffect, useState } from "react";
import GridWrapper from "../gridWrapper";
import HivChart from "../../../../components/charts/other/hivCharts";
import { useHistory } from "react-router-dom";
import { message, notification } from "antd";

import { getBillList } from "utils/api/billApi";

import "assets/less/components/charts/billChart.less";

// 布局位置
const layouts = {
  lg: [
    { i: "a", x: 0, y: 0, w: 24, h: 14, minH: 10, minW: 8 },
  ],
  md: [
    { i: "a", x: 2, y: 0, w: 20, h: 13, minH: 9, minW: 8 },
  ],
  sm: [
    { i: "a", x: 0, y: 0, w: 12, h: 13, minH: 9, minW: 6 },
  ]
};

const HIVChart = () => {
  const [data, setData] = useState([]);
  const history = useHistory();

//   useEffect(() => {
//     getBillList({ range: type })
//       .then(res => {
//         if (res.err === 0) {
//           setData(res.data);
//         } else if (res.err === -998) {
//           message.error("登录过期，请重新登录！");
//           history.push("/login");
//         } else {
//           notification.error({
//             message: res.msg
//           });
//         }
//       })
//       .catch(err => {
//         console.log(err);
//       });
//   }, []);

  return (
    <GridWrapper className="computer-chart" layouts={layouts}>
      <HivChart data={data} title="HIV" name="HIV模拟传染" />
    </GridWrapper>
  );
};

export default HIVChart;
